Skip to content

Conversation

@NoOne7135
Copy link
Contributor

No description provided.

- Introduced MAX_LOGS_SIZE environment variable to set the maximum allowed log size.
- Implemented log size checking and cleanup logic in the container database.
- Added utility function to parse human-readable size formats.
- Updated README to document the new MAX_LOGS_SIZE configuration option.
- Changed CheckBox alignment from end to start for better layout consistency.
- Adjusted CheckBox roll transformation for improved visual feedback.
- Modified DropDown text margin for better spacing.
@NoOne7135 NoOne7135 requested a review from ivictbor April 22, 2025 11:55
README.md Outdated
| AGENT | Toggles agent mode. If enabled, there will be no web interface available, and all logs will be sent and stored on HOST | `false` | -
| HOST | Url to OnLogs host from protocol to domain name. | | if `AGENT=true`
| ONLOGS_TOKEN | Token that will use an agent to authorize and connect to HOST | Generates with OnLogs interface | if `AGENT=true`
| MAX_LOGS_SIZE | Maximum allowed total logs size before cleanup triggers. Accepts human-readable formats like 5GB, 500MB, 1.5GB etc. When exceeded, 30% of logs (by count) will be removed proportionally across containers starting from oldest | 5GB | -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NoOne7135 can we decrease to 10%?

return "other"
}

func checkAndManageLogSize(host string, container string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't see ussage of host and container function params

func ParseHumanReadableSize(sizeStr string) (int64, error) {
sizeStr = strings.TrimSpace(strings.ToUpper(sizeStr))
for _, unit := range units {
if strings.HasSuffix(sizeStr, unit.Suffix) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets support 1g 1m etc also
if strings.HasSuffix(sizeStr, unit.Suffix) || strings.HasSuffix(sizeStr, strings.TrimSuffix(unit.Suffix, "B")) {

- Updated Docker build command to use --load for improved image handling.
- Changed output binary name from 'main' to 'onlogs' in the Dockerfile.
- Simplified log status key determination by removing redundant checks.
- Enhanced log size management logic to ensure efficient cleanup of old logs.
@NoOne7135 NoOne7135 merged commit 21983ba into main Apr 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants